﻿using MRSite.Common.Dependency;
using System;
using System.Collections.Generic;
using System.Data.Linq;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MRSite.Entity
{
    public class CustomContext : DataContext, ITransient
    {
        //protected static string connString = System.Configuration.ConfigurationManager.ConnectionStrings["SQLConn"].ToString();
        protected static string connString = "server=192.168.220.133;uid=sa;pwd=123@qwe;database=ShanYuMall_db;";


        #region 文章管理

        /// <summary>
        /// 文章类别
        /// </summary>
        public Table<ArticleCategory> ArticleCategorys;

        /// <summary>
        /// 文章
        /// </summary>
        public Table<Article> Articles;

        #endregion

        #region 会员管理
        /// <summary>
        /// 会员
        /// </summary>
        public Table<Customer> Customers;


        /// <summary>
        /// 会员类别
        /// </summary>
        public Table<CustomerGroups> CustomerGroupss;

        /// <summary>
        /// 会员级别
        /// </summary>
        public Table<CustomerLevels> CustomerLevelss;

        /// <summary>
        /// 用户收货地址
        /// </summary>
        public Table<user_address> UserAddrs;

        /// <summary>
        /// 会员登录日志
        /// </summary>
        public Table<Customerloginlog> Customerloginlogs;

        /// <summary>
        /// 升级
        /// </summary>
        public Table<UpgradeLog> UpgradeLogs;

        /// <summary>
        /// 前台登录错误次数管理
        /// </summary>
        public Table<CustomerLoginError> CustomerLoginErrors;


        #endregion



        #region 订单管理
        /// <summary>
        /// 订单
        /// </summary>
        public Table<Orders> Orderss;

        /// <summary>
        /// 订单明细
        /// </summary>
        public Table<OrderItem> OrderItems;

        /// <summary>
        /// 支付方式
        /// </summary>
        public Table<Payment> Payments;

        /// <summary>
        /// 快递
        /// </summary>
        public Table<Express> Expresss;

        /// <summary>
        /// 订单佣金统计
        /// </summary>
        public Table<OrderCommission> OrderCommissions;


        #endregion



        #region 商品
        /// <summary>
        /// 商品表
        /// </summary>
        public Table<Product> Products;

        /// <summary>
        /// 商品相册
        /// </summary>
        public Table<ProductAlbums> ProductAlbumss;

        /// <summary>
        /// 商品类别
        /// </summary>
        public Table<ProductCategory> ProductCategorys;

        /// <summary>
        /// 总平台类别
        /// </summary>
        public Table<ProductType> ProductTypes;

        /// <summary>
        /// 商品评论
        /// </summary>
        public Table<ProductComment> ProductComments;

        /// <summary>
        /// 商品sku
        /// </summary>
        public Table<ProductSku> ProductSkus;

        /// <summary>
        /// 商品会员价格
        /// </summary>
        public Table<CustomerGroupPrice> CustomerGroupPrices;

        /// <summary>
        /// 购物车
        /// </summary>
        public Table<CustomerCart> CustomerCarts;

        /// <summary>
        /// 收藏表
        /// </summary>
        public Table<CustomerCollect> CustomerCollects;


        /// <summary>
        /// 规格表
        /// </summary>
        public Table<ProductSpec> ProductSpecs;

        /// <summary>
        /// 规格项表
        /// </summary>
        public Table<ProductSpecItem> ProductSpecItems;

        /// <summary>
        /// 规格项目表
        /// </summary>
        public Table<ProductOption> ProductOptions;


        #endregion


        #region 系统管理
        /// <summary>
        /// 管理员
        /// </summary>
        public Table<Manager> Managers;

        /// <summary>
        /// 管理员角色
        /// </summary>
        public Table<manager_role> manager_roles;

        /// <summary>
        /// 管理员角色权限
        /// </summary>
        public Table<manager_role_value> manager_role_values;

        /// <summary>
        /// 后台登录错误次数管理
        /// </summary>
        public Table<ManagerLoginError> ManagerLoginErrors;


        /// <summary>
        /// 管理员日志
        /// </summary>
        public Table<manager_log> manager_logs;

        /// <summary>
        /// 管理员菜单
        /// </summary>
        public Table<navigation> navigations;

        /// <summary>
        /// 银行卡
        /// </summary>
        public Table<Bank> Banks;


        /// <summary>
        /// banner
        /// </summary>
        public Table<Banner> Banners;

        /// <summary>
        /// 轮播图类别 
        /// </summary>
        public Table<BannerCategory> BannerCategorys;


        /// <summary>
        /// 短讯通知模版
        /// </summary>
        public Table<SmsTemplate> SmsTemplates;

        /// <summary>
        /// 邮件模版
        /// </summary>
        public Table<MailTemplate> MailTemplates;


        /// <summary>
        /// 消息
        /// </summary>
        public Table<Message> Messages;

        /// <summary>
        /// 错误日志
        /// </summary>
        public Table<Logs> Logss;

        /// <summary>
        /// 留言
        /// </summary>
        public Table<Feedback> Feedbacks;


        #endregion


        #region 服务网点
        /// <summary>
        /// 服务网点
        /// </summary>
        public Table<Servicecenter> Servicecenters;

        /// <summary>
        /// 服务网点绑定表
        /// </summary>
        public Table<ServiceBind> ServiceBinds;

        /// <summary>
        /// 服务奖励标记
        /// </summary>
        public Table<ServiceReturnDayFlag> ServiceReturnDayFlags;

        /// <summary>
        /// 服务网点共建值释放记录
        /// </summary>
        public Table<ServiceReturnLog> ServiceReturnLogs;


        /// <summary>
        /// 服务奖励记录
        /// </summary>
        public Table<Service_AmountLog> Service_AmountLogs;

        /// <summary>
        /// 服务网点订单
        /// </summary>
        public Table<ServiceOrders> ServiceOrderss;


        #endregion

        #region 代理
        /// <summary>
        /// 代理
        /// </summary>
        public Table<AgentUser> AgentUsers;

        /// <summary>
        /// 代理等级
        /// </summary>
        public Table<AgentLevel> AgentLevels;

        #endregion



        #region 共建值日志管理


        /// <summary>
        /// 会员充值
        /// </summary>
        public Table<Recharge> Recharges;


        /// <summary>
        /// 提现
        /// </summary>
        public Table<Withdrawal> Withdrawals;



        /// <summary>
        /// 转账明细
        /// </summary>
        public Table<Transfer> Transfers;

        /// <summary>
        /// 积分转余额明细
        /// </summary>
        public Table<Transform> Transforms;

        /// <summary>
        /// 会员交易记录
        /// </summary>
        public Table<Amountlog> Amountlogs;

        /// <summary>
        /// 共建值奖金明细
        /// </summary>
        public Table<IncomeLog> IncomeLogs;



        /// <summary>
        /// 积分日志
        /// </summary>
        public Table<Pointlog> Pointlogs;

        /// <summary>
        /// 报单记录
        /// </summary>
        public Table<Declaration> Declarations;

        /// <summary>
        /// 共建值日返记录
        /// </summary>
        public Table<CustomerGoldReturn> CustomerGoldReturns;

        /// <summary>
        /// 锁仓共建值转换可用共建值 标记
        /// </summary>
        public Table<GoldReturnDayFlag> GoldReturnDayFlags;


        /// <summary>
        /// 可用共建值日志
        /// </summary>
        public Table<Goldlog> Goldlogs;

        /// <summary>
        /// 锁仓共建值日志
        /// </summary>
        public Table<Goldlog_SC> Goldlog_SCs;

        /// <summary>
        /// 首购奖励日志
        /// </summary>
        public Table<Goldlog_SGJL> Goldlog_SGJLs;


        /// <summary>
        /// 消费奖励 标记
        /// </summary>
        public Table<GoldFengHongDayFlag> GoldFengHongDayFlags;

        /// <summary>
        /// 消费奖励释放明细
        /// </summary>
        public Table<CustomerGoldFengHong> CustomerGoldFengHongs;




        /// <summary>
        /// 红包日志
        /// </summary>
        public Table<GfHongbaolog> GfHongbaologs;

        /// <summary>
        /// 红包奖金明细
        /// </summary>
        public Table<IncomeHongBaoLog> IncomeHongBaoLogs;


        #endregion



        #region 交易市场
        /// <summary>
        /// 设置表
        /// </summary>
        public Table<BiSetting> BiSettings;

        /// <summary>
        /// 价格变动表
        /// </summary>
        public Table<BiChangeLog> BiChangeLogs;

        /// <summary>
        /// 交易市场表
        /// </summary>
        public Table<BiMarket> BiMarkets;

        /// <summary>
        /// 币锁日志
        /// </summary>
        public Table<BiLocklog> BiLocklogs;

        #endregion



        /// <summary>
        /// 签到表
        /// </summary>
        public Table<QianDao> QianDaos;



        #region 参数设置

        /// <summary>
        /// 个人红包考核规则
        /// </summary>
        public Table<SiteAdward_Hongbao> SiteAdward_Hongbaos;

        /// <summary>
        /// 可用共建值释放规则
        /// </summary>
        public Table<SiteAdward_Return> SiteAdward_Returns;

        // /// <summary>
        ///// 团队奖励规则
        ///// </summary>
        //public Table<TeamAdward> TeamAdwards;




        #endregion

        #region 新闻
        /// <summary>
        /// 新闻分类
        /// </summary>
        public Table<NewsCategory> NewsCategorys;

        /// <summary>
        /// 新闻
        /// </summary>
        public Table<News> Newss;


        /// <summary>
        /// 新闻评论
        /// </summary>
        public Table<NewsComment> NewsComments;

        /// <summary>
        /// 阅读记录
        /// </summary>
        public Table<NewsRead> NewsReads;

        /// <summary>
        /// 点赞记录
        /// </summary>
        public Table<NewsLoves> NewsLovess;



        #endregion

        #region 贡献值

        /// <summary>
        /// 贡献值日志
        /// </summary>
        public Table<ScoreLog> ScoreLogs;

        /// <summary>
        /// 贡献值奖励明细
        /// </summary>
        public Table<IncomeScoreLog> IncomeScoreLogs;



        /// <summary>
        /// 贡献值 待缓释放充值
        /// </summary>
        public Table<ScoreWaitRecharge> ScoreWaitRecharges;
        /// <summary>
        /// 贡献值转共建值记录
        /// </summary>
        public Table<ScoreToZiCanReturn> ScoreToZiCanReturns;

        /// <summary>
        /// 贡献值转换标记
        /// </summary>
        public Table<ScoreReturnDayFlag> ScoreReturnDayFlags;



        #endregion



        #region 店铺


        /// <summary>
        /// 总店铺
        /// </summary>
        public Table<ShopSetting> ShopSettings;

        /// <summary>
        /// 店铺分类
        /// </summary>
        public Table<ShopCategory> ShopCategorys;

        /// <summary>
        /// 店铺
        /// </summary>
        public Table<Shop> Shops;

        /// <summary>
        /// 店铺类型-店铺级别（1：个人店；2：企业店）
        /// </summary>
        public Table<ShopType> ShopTypes;

        /// <summary>
        /// 店铺货款共建值流水
        /// </summary>
        public Table<ShopAccountDetail> ShopAccountDetails;

        /// <summary>
        /// 店铺交易流水
        /// </summary>
        public Table<ShopAmountlog> ShopAmountlogs;

        /// <summary>
        /// 店铺 后台操作日志
        /// </summary>
        public Table<ShopManage_log> ShopManage_logs;

        /// <summary>
        /// 店铺 后台菜单 
        /// </summary>
        public Table<ShopMenu> ShopMenus;

        /// <summary>
        /// 店铺 银行卡 
        /// </summary>
        public Table<ShopBank> ShopBanks;

        /// <summary>
        /// 店铺 提现表 
        /// </summary>
        public Table<ShopWithdrawal> ShopWithdrawals;

        /// <summary>
        /// 店铺申请订单表 
        /// </summary>
        public Table<ShopOrders> ShopOrderss;


        #endregion

        #region 数据统计
        /// <summary>
        /// 用户数据统计
        /// </summary>
        public Table<UserTongJi_Month> UserTongJi_Months;

        /// <summary>
        /// 用户可用共建值释放考核数据
        /// </summary>
        public Table<Report_UserKaohe> Report_UserKaohes;

        /// <summary>
        /// 站点统计数据
        /// </summary>
        public Table<SiteTongJi> SiteTongJis;


        /// <summary>
        /// 平台每天资产统计数据
        /// </summary>
        public Table<Report_Site_ZiChan_Day> Report_Site_ZiChan_Days;

        #endregion

        #region 大转盘

        /// <summary>
        /// 大转盘基本设置表
        /// </summary>
        public Table<dzpActionInfo> dzpActionInfos;

        /// <summary>
        /// 大转盘奖品列表
        /// </summary>
        public Table<dzpAwardItem> dzpAwardItems;


        /// <summary>
        /// 大转盘中奖用户信息
        /// </summary>
        public Table<dzpAwardUser> dzpAwardUsers;

        /// <summary>
        /// 大转盘用户抽奖临时表
        /// </summary>
        public Table<dzpUsersTemp> dzpUsersTemps;


        #endregion

        #region 任务 

        /// <summary>
        /// 批发商更改路径任务 
        /// </summary>
        public Table<Task_UserPfs> Task_UserPfss;


        #endregion

        public CustomContext() : base(connString) { }
        public CustomContext(string connection) : base(connection) { }

    }
}
